<?php
	session_start();
?>
<html>


	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, user-scalable=no"/>
		
        <!--CSS-->
        <link rel="stylesheet" href="styles/style1.css">
        <link rel="stylesheet" href="styles/jquery-ui-1.8.17.custom.css" />
		<link rel="stylesheet" href="styles/table_jui.css" />
		<?php if(isset($_GET['p']) && file_exists("styles/" . $_GET["p"] . ".css")){ //CSS de la page ?>
        <link rel="stylesheet" href="styles/<?php echo $_GET["p"];?>.css" />
		<?php }?>	
		
       <!-- JAVASCRIPT-->       
		<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
		<script type="text/javascript" src="js/jquery-ui-1.8.17.custom.min.js"></script>
        <script type="text/javascript" src="js/jquery.dataTables.min.js"></script>
        <script type="text/javascript">
			//Zone de javascript generale.
		$(document).ready(function(){
			//Zone de Jquery globale
		
		
		<?php 
			//Zone de Jquery adapte a la page.
			if (isset($_GET['p']) && file_exists("js/" . $_GET["p"] . ".js" ))
					require_once("js/" . $_GET["p"] . ".js");
		?>
		});
		</script> 
        <title>Rakotokaf&eacute;</title>
	</head>
	
	
	<body>
		<header>
		<h1>Rakotokaf&eacute;</h1>
		</header>
		
		<?php
			if(!isset($_SESSION['ID'])){
		?>

			<form id="login" class="form" method="post" action="src/connexion.php">
				<h2>Connexion</h2>
				<fieldset id="inputs">
					<input id="username" class="inputs" name="username" type="text" autocorrect="off" placeholder="Utilisateur" autofocus required>
					<input id="password" class="inputs" name="password" type="password" placeholder="Mot de passe" required>
				</fieldset>
				
				<fieldset id="actions">
					<input type="submit" class ="submit" value="Connexion">
				</fieldset>
			</form>
		
		<?php
		
		}
		else{
		?>
		
			<div id="top">
				<a href="index.php" class="home">Accueil</a>
				<a href="src/deconnexion.php" class="logout">D&eacute;connexion</a>
			</div>
			
			<div id="content">
			<?php
				if (isset($_GET['p']) && file_exists("src/" . $_GET['p'] . ".php"))
				{
					include("src/" . $_GET['p'] . ".php");	
				} 
				else
				{            
			?>
			<div id="choix_secteur">
				<div class="bloc clearB">
					<a class="divClick" href="index.php?p=serveur">
						<img src="images/serv.png" class="fLeft"></img>
						<h3 class="right">Serveur</h3> 
						<p class="noMargin text">
						Ici vous g&eacute;rez la prise, le service et le reglement des commandes client
						</p>
					</a>
				</div>
				<div class="bloc clearB">
					<a class="divClick" href="index.php?p=barman">
						<img class="fRight" src="images/barm.png"></img>
						<h3>Barman</h3>
						<p class="noMargin text">
						Ici vous g&eacute;rez les commandes client en attente
						</p>
					</a>
				</div>
				<div class="bloc clearB">
					<a class="divClick" href="index.php?p=administration">
						<img src="images/administration.png" class="fLeft"></img>
						<h3 class="right">Administration</h3>
						<p class="noMargin text">
						Ici vous administez l'intranet
						</p>
					</a>
				</div>
			</div>
			<?php 
        	}
		}
		?>
		</div>
		<footer>
            <p>
            	2011 : Rakotokaf&eacute;
            </p>
        </footer>
		
	<body>
</html>
